home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Message Dialogs
/
customizable-js-prompt.izs
< prev
next >
Wrap
Text File
|
2005-09-28
|
9KB
|
297 lines
<!NOWIZARD>
<!TITLE>Customizable JavaScript Prompt
<!/TITLE>
<!DESCRIPTION> This script is used to generate a customized prompt box. With the use of a timer function you can generate it automatically.
<!/DESCRIPTION>
<!CATEGORY>Messages<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CUSTOMIZABLE JAVASCRIPT PROMPT:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<!-- Original: Mukesh/Ritesh (mukesh@netedgecomputing.com) -->
<!-- Web Site: http://www.netedgecomputing.com -->
<style type="text/css">
<!--/*************************** below code can be in a css file *****************************/-->
input.prompt {border:1 solid transparent; background-color:#99ccff;width:70;font-family:arial;font-size:12; color:black;}
td.titlebar { background-color:#FF9F40; color:#0000D2; font-weight:bold;font-family:arial; font-size:12;}
table.promptbox {border:1 solid #ccccff; background-color:#FFFFE6; color:black;padding-left:2;padding-right:2;padding-bottom:2;font-family:arial; font-size:12;}
input.promptbox {border:1 solid #0000FF; background-color:white;width:100%;font-family:arial;font-size:12; color:black; }
<!--/*************************** end css file *****************************/-->
</style>
<script language='javascript'>
/*************************** below code can be in a js file *****************************/
var response = null
function prompt2(promptpicture, prompttitle, message, sendto) {
promptbox = document.createElement('div');
promptbox.setAttribute ('id' , 'prompt')
document.getElementsByTagName('body')[0].appendChild(promptbox)
promptbox = eval("document.getElementById('prompt').style")
promptbox.position = 'absolute'
promptbox.top = 100
promptbox.left = 200
promptbox.width = 300
promptbox.border = 'outset 1 #bbbbbb'
document.getElementById('prompt').innerHTML = "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr valign='middle'><td width='22' height='22' style='text-indent:2;' class='titlebar'><img src='" + promptpicture + "' height='18' width='18'></td><td class='titlebar'>" + prompttitle + "</td></tr></table>"
document.getElementById('prompt').innerHTML = document.getElementById('prompt').innerHTML + "<table cellspacing='0' cellpadding='0' border='0' width='100%' class='promptbox'><tr><td>" + message + "</td></tr><tr><td><input type='text' id='promptbox' onblur='this.focus()' class='promptbox'></td></tr><tr><td align='right'><br><input type='button' class='prompt' value='OK' onMouseOver='this.style.border=\"1 outset #dddddd\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(document.getElementById(\"promptbox\").value); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'> <input type='button' class='prompt' value='Cancel' onMouseOver='this.style.border=\"1 outset transparent\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(\"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'></td></tr></table>"
document.getElementById("promptbox").focus()
}
function myfunction(value) {
if(value.length<=0)
return false;
else
document.getElementById('output').innerHTML="<b>"+value+"</b>";
}
/*************************** js file code *****************************/
</script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function callPrompt(){
prompt2('btn1p.gif', 'My Prompt','Please enter your name ,if you want to chat with our <B>customer support executive</B>', 'myfunction');
}
//-->
</SCRIPT>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<!-- Original: Mukesh/Ritesh (mukesh@netedgecomputing.com) -->
<!-- Web Site: http://www.netedgecomputing.com -->
<input type="button" value='show prompt' onClick="callPrompt()"> </CENTER>
<div id="output" style="position:absolute;background-color:#FFFFCC;width:200;height:50;left:300;top:150;border:1 solid #FF8000;color:#0000F2"></div>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CUSTOMIZABLE JAVASCRIPT PROMPT:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<!-- Original: Mukesh/Ritesh (mukesh@netedgecomputing.com) -->
<!-- Web Site: http://www.netedgecomputing.com -->
<style type="text/css">
<!--/*************************** below code can be in a css file *****************************/-->
input.prompt {border:1 solid transparent; background-color:#99ccff;width:70;font-family:arial;font-size:12; color:black;}
td.titlebar { background-color:#FF9F40; color:#0000D2; font-weight:bold;font-family:arial; font-size:12;}
table.promptbox {border:1 solid #ccccff; background-color:#FFFFE6; color:black;padding-left:2;padding-right:2;padding-bottom:2;font-family:arial; font-size:12;}
input.promptbox {border:1 solid #0000FF; background-color:white;width:100%;font-family:arial;font-size:12; color:black; }
<!--/*************************** end css file *****************************/-->
</style>
<script language='javascript'>
/*************************** below code can be in a js file *****************************/
var response = null
function prompt2(promptpicture, prompttitle, message, sendto) {
promptbox = document.createElement('div');
promptbox.setAttribute ('id' , 'prompt')
document.getElementsByTagName('body')[0].appendChild(promptbox)
promptbox = eval("document.getElementById('prompt').style")
promptbox.position = 'absolute'
promptbox.top = 100
promptbox.left = 200
promptbox.width = 300
promptbox.border = 'outset 1 #bbbbbb'
document.getElementById('prompt').innerHTML = "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr valign='middle'><td width='22' height='22' style='text-indent:2;' class='titlebar'><img src='" + promptpicture + "' height='18' width='18'></td><td class='titlebar'>" + prompttitle + "</td></tr></table>"
document.getElementById('prompt').innerHTML = document.getElementById('prompt').innerHTML + "<table cellspacing='0' cellpadding='0' border='0' width='100%' class='promptbox'><tr><td>" + message + "</td></tr><tr><td><input type='text' id='promptbox' onblur='this.focus()' class='promptbox'></td></tr><tr><td align='right'><br><input type='button' class='prompt' value='OK' onMouseOver='this.style.border=\"1 outset #dddddd\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(document.getElementById(\"promptbox\").value); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'> <input type='button' class='prompt' value='Cancel' onMouseOver='this.style.border=\"1 outset transparent\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(\"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'></td></tr></table>"
document.getElementById("promptbox").focus()
}
function myfunction(value) {
if(value.length<=0)
return false;
else
document.getElementById('output').innerHTML="<b>"+value+"</b>";
}
/*************************** js file code *****************************/
</script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function callPrompt(){
prompt2('btn1p.gif', 'My Prompt','Please enter your name ,if you want to chat with our <B>customer support executive</B>', 'myfunction');
}
//-->
</SCRIPT>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<!-- Original: Mukesh/Ritesh (mukesh@netedgecomputing.com) -->
<!-- Web Site: http://www.netedgecomputing.com -->
<input type="button" value='show prompt' onClick="callPrompt()"> </CENTER>
<div id="output" style="position:absolute;background-color:#FFFFCC;width:200;height:50;left:300;top:150;border:1 solid #FF8000;color:#0000F2"></div>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>